//导入 percent 函数
const percent = require('./percent');
//导入 toastr
const toastr = require('toastr');
//获取 button
let btn = document.querySelector('button');

//绑定事件
btn.onclick = function(){
  if(percent(30)){
    toastr.success('恭喜恭喜 奖品为 100w 劳斯莱斯优惠券')
  }else{
    toastr.warning('再接再厉')
  }
}